﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DreamWork.Model.ViewModel
{
    public abstract class JsonResultBase
    {
        /// <summary>
        /// Operation result.
        /// </summary>
        public virtual bool IsSuccess { get; set; } = true;
        public virtual string ErrorCode { get; set; }
        public virtual string Message { get; set; }
        public IEnumerable<MetaData> MetaData { get; set; }
    }
    public class JsonResponseResult : JsonResultBase
    {
    }
    public class DataJsonResult : JsonResponseResult
    {
        public object Data { get; set; }
    }
    public class PagedJsonResult : JsonResponseResult
    {
        public PageResultInfo PageInfo { get; set; }
        public IEnumerable<object> Data { get; set; }
    }

    public class ListJsonResult : JsonResponseResult
    {
        public IEnumerable<object> Data { get; set; }
    }
  
    public class WebSocketJsonResult : JsonResponseResult
    {
        public bool IsClose { get; set; }
        public object Data { get; set; }
    }
    public class DataJsonResult<T> : JsonResponseResult
    {
        public T Data { get; set; }
    }
    public class PagedJsonResult<T> : JsonResponseResult
    {
        public PageResultInfo PageInfo { get; set; }
        public IEnumerable<T> Data { get; set; }
    }

    public class PagedStringResult<T> : JsonResponseResult
    {
        public PageResultInfo PageInfo { get; set; }
        public string Data { get; set; }
    }

    public class ListJsonResult<T> : JsonResponseResult
    {
        public IEnumerable<T> Data { get; set; }
    }

}
